package com.jeffdouglas.sashimi.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class MyPanel extends Composite {
	
	  private static MyPanelUiBinder uiBinder = GWT.create(MyPanelUiBinder.class);
	  
	  interface MyPanelUiBinder extends UiBinder<Widget, MyPanel> {
	  }
	 
	  private SomeObject someObject;
	 
	  public MyPanel() {
	    this.someObject = new SomeObject("My object text");
	    initWidget(uiBinder.createAndBindUi(this));
	  }
	 
	  // Add a UI Factory method for the sub-widget & pass object
	  @UiFactory
	  SomeWidget makeSomeWidget() {
	    return new SomeWidget(someObject);
	  }
	 
	}